package Chapter9;
import java.awt.*;
import java.awt.event.*;
public class Example07 {
	public static void main(String[] args) {
		Frame f=new Frame("KeyWvent");
		f.setLayout(new FlowLayout());
		f.setSize(400,300);
		f.setLocation(300, 200);
		f.setVisible(true);
		TextField tf=new TextField(30);
		f.add(tf);
		tf.addKeyListener(new KeyAdapter() {
			public void keyPressed(KeyEvent e) {
				int KeyCode=e.getKeyCode();
				String s=KeyEvent.getKeyText(KeyCode);
				System.out.print("input "+s+",");
				System.out.println("keycode: "+KeyCode);
			}
		});
	}

}
